<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
	<canvas id="canvas" height="500" width="500" style="border:1px solid #000"></canvas>

</body>
</html>


<script type="text/javascript">
	var canvas = document.getElementById('canvas');
	var context = canvas.getContext('2d');
	context.shadowBlur = 10;//设置阴影的模糊程度为10//
	context.shadowOffsetX = 20;//设置阴影横坐标平移20//
	context.shadowColor = 'black';//设置阴影颜色为黑色//
	context.fillStyle = 'red';
	context.fillRect(30,30,200,100)
	
</script>